<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\logic\TeamOrderLogic;
use app\common\logic\TeamFoundLogic;
use think\Db;



/**
 * 拼团开团接口
 */
class TeamFound extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    protected $model;

    public function _initialize(){
        $this->model = new \app\common\model\TeamFollow();
    }

    /**
     * 查看
     */
    public function index()
    {
        $this->dataLimit = true;
        list($where, $sort, $order, $offset, $limit , $field) = $this->buildparams();

        $total = $this->model
            ->where($where)
            ->order($sort, $order)
            ->count();

        $list = $this->model
            ->field($field)
            ->where($where)
            ->order($sort, $order)
            ->limit($offset, $limit)
            ->select();

        $result = array("total" => $total, "rows" => $list);


        $this->success('',$result);


    }
}